#ifndef EDITFORM_H
#define EDITFORM_H

#include <QWidget>
#include <opencv2/opencv.hpp>
#include <QMouseEvent>
#include <list>
#include "datastruct.h"
#include "cvxtext.h"

using namespace cv;
using namespace std;

namespace Ui {
class EditForm;
}

class EditForm : public QWidget
{
    Q_OBJECT

public:
    explicit EditForm(QWidget *parent = 0);
    ~EditForm();
    void getFrame(Mat frame,double width,double height,int frame_now);
    void showFrame();
    list<SubtitleInfo> getSubtitle();
    list<BoxInfo> getBox();

protected:
    void mousePressEvent(QMouseEvent *event);
    void closeEvent(QCloseEvent *event);

private slots:
    void on_pushButton_subtitle_clicked();

    void on_pushButton_box_clicked();

    void on_pushButton_subtitle_sure_clicked();

    void on_pushButton_box_sure_clicked();

    void on_pushButton_finish_clicked();

private:
    Ui::EditForm *ui;
    VideoCapture capture;
    Mat frame;
    double width;
    double height;
    int width1;
    int height1;
    int box_type;
    list<SubtitleInfo> l_subtitle;
    list<BoxInfo> l_box;
    CvxText *cvtext;

signals:
    void editClose(int x);
};

#endif // EDITFORM_H
